package com.boda.web.action;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.apache.struts2.interceptor.SessionAware;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.boda.common.constant.PageConst;
import com.boda.web.model.PageModel;
import com.opensymphony.xwork2.ActionSupport;

public abstract class BaseAction extends ActionSupport implements SessionAware, ServletRequestAware, ServletResponseAware {
    private static final long serialVersionUID = 1L;
    protected final Logger log = LoggerFactory.getLogger(this.getClass());

    // 页面跳转
    protected final String LOGIN = "login";

    protected String lookup;
    protected String orderIndexs;
    protected String id;
    protected String[] ids;

    protected PageModel pageModel = new PageModel();
    protected int offset = PageConst.DEFAULT_PAGE_OFFSET;
    protected int pageSize = PageConst.DEFAULT_PAGE_SIZE;

    protected Map<String, Object> session;
    protected HttpServletRequest request;
    protected HttpServletResponse response;

    public void setSession(Map<String, Object> session) {
        this.session = session;
    }

    public void setServletRequest(HttpServletRequest request) {
        this.request = request;
    }

    public void setServletResponse(HttpServletResponse response) {
        this.response = response;
    }

    public String getOrderIndexs() {
        return orderIndexs;
    }

    public void setOrderIndexs(String orderIndexs) {
        this.orderIndexs = orderIndexs;
    }

    public String getLookup() {
        return lookup;
    }

    public void setLookup(String lookup) {
        this.lookup = lookup;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String[] getIds() {
        return ids;
    }

    public void setIds(String[] ids) {
        this.ids = ids;
    }

    public PageModel getPageModel() {
        return pageModel;
    }

    public void setPageModel(PageModel pageModel) {
        this.pageModel = pageModel;
    }

    public int getOffset() {
        return offset;
    }

    public void setOffset(int offset) {
        this.offset = offset;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
}
